package com.mayuanfei.springboot03.controller;

import com.mayuanfei.springboot03.config.User1;
import com.mayuanfei.springboot03.config.User2;
import com.mayuanfei.springboot03.config.User3;
import com.mayuanfei.springboot03.config.User4;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 演示yml配置文件
 *
 * @author 老马
 * @date 2023-04-21 16:16
 */
@RestController
public class ShowConfigController {
    @Value("${mykey}")
    private String myKey;
    @Resource
    private User1 user1;
    @Resource
    private User2 user2;
    @Resource
    private User3 user3;
    @Resource
    private User4 user4;


    @GetMapping("/showMyKey")
    public String showMyKey() {
        return myKey;
    }

    @GetMapping("/showUser1")
    public User1 showUser1() {
        return user1;
    }

    @GetMapping("/showUser2")
    public User2 showUser2() {
        return user2;
    }

    @GetMapping("/showUser3")
    public User3 showUser3() {
        return user3;
    }

    @GetMapping("/showUser4")
    public User4 showUser4() {
        return user4;
    }

}